<template>
  <div id="myChart" :style="{width: '600px', height: '200px'}"></div>
</template>

<script>
export default {
  name: 'OrderEcharts',
  data () {
    return {
    }
  },
  mounted(){
    this.drawLine();
  },
  methods: {
    drawLine(){
      // 基于刚刚准备好的 DOM 容器，初始化 EChart 实例
      let myChart = this.$echarts.init(document.getElementById('myChart'))
      // 绘制图表
      myChart.setOption({

        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: ['下单笔数', '付款订单']
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },


        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ["2022-06-13","2022-06-14","2022-06-15","2022-06-16","2022-06-17"]
        },
        yAxis: {
          type: 'value',
          minInterval:1
        },
        series: [
          {
            name: '付款订单',
            data: [0, 1, 0, 0, 0],
            type: 'line',

          },
          {
            name: '下单笔数',
            data: [0, 2, 0, 0, 0],
            type: 'line',

          }
        ]
      });
    }
  }
}
</script>
